home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_7690.txt < prev    next >
Text File  |  1989-05-10  |  6KB  |  197 lines

  1. -- card: 7690 from stack: in.6
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3411
  5. -- name: Color Icon Bars
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 80
  10. -- high flags: A003
  11. -- rect: left=298 top=94 right=117 bottom=398
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Bottom Icons
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put the screenrect into it
  23.   if item 4 of it <= 342 then
  24.     put 280 into top
  25.   else put 355 into top
  26.   ShowDialog 1,3120,"",FALSE,top,0
  27.   if the result = 1 then
  28.     put "first" into theIcon
  29.   else if the result = 2 then
  30.     put "second" into theIcon
  31.   else if the result = 3 then
  32.     put "third" into theIcon
  33.   else if the result = 4 then
  34.     put "fourth" into theIcon
  35.   else if the result = 5 then
  36.     put "fifth" into theIcon
  37.   else if the result = 6 then
  38.     put "sixth" into theIcon
  39.   else if the result = 7 then
  40.     put "seventh" into theIcon
  41.   else if the result = 8 then
  42.     put "eighth" into theIcon
  43.   else if the result = 9 then
  44.     put "ninth" into theIcon
  45.   else if the result = 10 then
  46.     put "tenth" into theIcon
  47.   end if
  48.   put "You selected the" && theIcon && "Icon!" into bg fld "theResult"
  49. end mouseUp
  50.  
  51.  
  52.  
  53. -- part 2 (button)
  54. -- low flags: 80
  55. -- high flags: A003
  56. -- rect: left=270 top=180 right=203 bottom=434
  57. -- title width / last selected line: 0
  58. -- icon id / first selected line: 0 / 0
  59. -- text alignment: 1
  60. -- font id: 0
  61. -- text size: 12
  62. -- style flags: 0
  63. -- line height: 16
  64. -- part name: Bottom Icons with Text
  65. ----- HyperTalk script -----
  66. on mouseUp
  67.   put the screenrect into it
  68.   if item 4 of it <= 342 then
  69.     put 273 into top
  70.     put 100 into left
  71.   else
  72.     put 340 into top
  73.     put 110 into left
  74.   end if
  75.   ShowDialog 1,3122," Click on an icon to do something:",FALSE,top,left
  76.   if the result = 1 then
  77.     put "first" into theIcon
  78.   else if the result = 2 then
  79.     put "second" into theIcon
  80.   else if the result = 3 then
  81.     put "third" into theIcon
  82.   else if the result = 4 then
  83.     put "fourth" into theIcon
  84.   else if the result = 5 then
  85.     put "fifth" into theIcon
  86.   else if the result = 6 then
  87.     put "sixth" into theIcon
  88.   end if
  89.   put "You selected the" && theIcon && "Icon!" into bg fld "theResult"
  90. end mouseUp
  91.  
  92.  
  93.  
  94. -- part 3 (button)
  95. -- low flags: 80
  96. -- high flags: A003
  97. -- rect: left=283 top=137 right=160 bottom=418
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 1
  101. -- font id: 0
  102. -- text size: 12
  103. -- style flags: 0
  104. -- line height: 16
  105. -- part name: Vertical Icons
  106. ----- HyperTalk script -----
  107. on mouseUp
  108.   put the screenrect into it
  109.   if item 4 of it <= 342 then
  110.     put 454 into left
  111.     put 0 into top
  112.   else
  113.     put 520 into left
  114.     put -8 into top
  115.   end if
  116.   ShowDialog 1,3121,"",FALSE,top,left
  117.   if the result = 1 then
  118.     put "first" into theIcon
  119.   else if the result = 2 then
  120.     put "second" into theIcon
  121.   else if the result = 3 then
  122.     put "third" into theIcon
  123.   else if the result = 4 then
  124.     put "fourth" into theIcon
  125.   else if the result = 5 then
  126.     put "fifth" into theIcon
  127.   else if the result = 6 then
  128.     put "sixth" into theIcon
  129.   else if the result = 7 then
  130.     put "seventh" into theIcon
  131.   else if the result = 8 then
  132.     put "eighth" into theIcon
  133.   end if
  134.   put "You selected the" && theIcon && "Icon!" into bg fld "theResult"
  135. end mouseUp
  136.  
  137.  
  138.  
  139. -- part 5 (button)
  140. -- low flags: 00
  141. -- high flags: 0000
  142. -- rect: left=11 top=4 right=64 bottom=78
  143. -- title width / last selected line: 0
  144. -- icon id / first selected line: 529 / 529
  145. -- text alignment: 1
  146. -- font id: 0
  147. -- text size: 12
  148. -- style flags: 0
  149. -- line height: 16
  150. -- part name: SD
  151.  
  152.  
  153. -- part contents for background part 21
  154. ----- text -----
  155. Color Icon Bars
  156.  
  157. -- part contents for background part 18
  158. ----- text -----
  159. What a shame it is to have a large screen but still be welded to a 5 x 7 1/4 inch card window!  Wouldn't it be great if you could extend the boundaries of HyperCard to perform certain tasks!
  160. Do you find that your card windows get too cluttered because you try and squeeze too much on a single card?
  161.  
  162. If you have the luxury of having a large screen, you can use ShowDialog XCMD to extend the physical boundaries of HyperCard by placing the dialog box OUTSIDE the card window.  This is most useful for placing an icon bar below or to the side of the card window.  In designing your icon bar DLOG/DITL template, make the icons enabled.  Then clicking on an icon will dismiss the dialog and return the item number of the icon in "the result."
  163.  
  164.  
  165. -- part contents for background part 17
  166. ----- text -----
  167. In your script remember to query HyperCard for the screen size first so that the icon bar will NOT appear offscreen if someone should use your stack on a small screen!
  168.  
  169. See the scripts of the demo buttons for examples of this.
  170.  
  171. Creating cicn's (color icons):
  172. ResEdit currently does not support the creation of cicn's.  In the public domain there exists an application called Color Icon Editor that will allow you to create beautiful full color icons.
  173.  
  174. CompuServe; MacPro;  
  175. Data Library 10 (Mac II Software): CICN.ED
  176.  
  177. -- part contents for background part 15
  178. ----- text -----
  179. Use ShowDialog Type 1 to create color icon bars:
  180.  
  181. Example:
  182. ShowDialog 1,3121,"",FALSE,top,left
  183.  
  184. where
  185. param 1 is the type;
  186. param 2 is the DLOG resource ID;
  187. param 3 is a prompt;
  188. param 4 is a BOOLEAN for outlining DITL item #1
  189. (This wants to be FALSE for icon bars);
  190. param 5 is the top coordinate of the dialog;
  191. param 6 is the left coordinate of the dialog.
  192.  
  193. See the card "ShowDialog XCMD Type 1" for more information.
  194.  
  195. -- part contents for background part 30
  196. ----- text -----
  197. 21